﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Hotel_Management.Recepcjonista
{
    public partial class Faktura : System.Web.UI.Page
    {
        
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            GridView1.DataBind();
           

        }

        protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
        {

            GridViewRow row = GridView1.SelectedRow;
            string container = row.Cells[1].Text;
            TextBox3.Text = container;






        }

        protected void GridView2_SelectedIndexChanged(object sender, EventArgs e)
        {
            GridViewRow row = GridView2.SelectedRow;
            string container = row.Cells[2].Text;
            string container1 = row.Cells[3].Text;
            string container2 = row.Cells[4].Text;
            DateTime przyjazd = Convert.ToDateTime(container1);
            DateTime odjazd = Convert.ToDateTime(container2);
            TimeSpan pobyt = odjazd - przyjazd;
            TextBox4.Text = container;
            Label7.Text += pobyt.Days.ToString();
            
        }

      
        protected void GridView3_SelectedIndexChanged(object sender, EventArgs e)
        {
            GridViewRow row = GridView3.SelectedRow;
            string container = row.Cells[2].Text;
            double cena = Convert.ToDouble(container);
            Label6.Text = cena.ToString();
            double temp = Convert.ToDouble(Label6.Text)*Convert.ToDouble(Label7.Text);
            razem.Text += temp.ToString();
        }
    }
}